#include "widget.h"
#include "ui_widget.h"
#include "server.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_textBtn_clicked(){
    WebsocketServer* websocketServer = WebsocketServer::getInstance();
    emit websocketServer->sendTextResp();
}

void Widget::on_removeFriendBtn_clicked(){
    WebsocketServer* websocketServer = WebsocketServer::getInstance();
    emit websocketServer->sendFriendRemove();
}
void Widget::on_AddFriendBtn_clicked(){
    WebsocketServer* websocketServer = WebsocketServer::getInstance();
    emit websocketServer->sendAddFriendApply();
}

void Widget::on_acceptFriendBtn_clicked(){
    WebsocketServer* websocketServer = WebsocketServer::getInstance();
    emit websocketServer->sendAddFriendProcess(true);
}
void Widget::on_rejectFriendBtn_clicked(){
    WebsocketServer* websocketServer = WebsocketServer::getInstance();
    emit websocketServer->sendAddFriendProcess(false);
}

void Widget::on_createSessionBtn_clicked(){
    WebsocketServer* websocketServer = WebsocketServer::getInstance();
    emit websocketServer->sendCreateChatSession();
}


void Widget::on_sendImageBtn_clicked(){
    WebsocketServer* websocketServer = WebsocketServer::getInstance();
    emit websocketServer->sendImageResp();
}

void Widget::on_sendFileBtn_clicked(){
    WebsocketServer* WebsocketServer = WebsocketServer::getInstance();
    emit WebsocketServer->sendFileResp();
}
































